using System;
using System.ComponentModel;

using DevExpress.Xpo;
using DevExpress.Data.Filtering;

using DevExpress.ExpressApp;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Persistent.Validation;

namespace PrimarySchoolManagement.Module.BusinessObjects
{
    [DefaultClassOptions]
    public class Mark : BaseObject
    {
        public Mark(Session session)
            : base(session)
        {
            // This constructor is used when an object is loaded from a persistent storage.
            // Do not place any code here or place it only when the IsLoading property is false:
            // if (!IsLoading){
            //    It is now OK to place your initialization code here.
            // }
            // or as an alternative, move your initialization code into the AfterConstruction method.
        }
        private int score;
        public int Score {
            get { return score; }
            set { SetPropertyValue("Score", ref score, value); }
        }
        private Subject subject;
        public Subject Subject {
            get { return subject; }
            set { SetPropertyValue("Subject", ref subject, value); }
        }
        private MarkType markType;
        public MarkType MarkType {
            get { return markType; }
            set { SetPropertyValue("MarkType", ref markType, value); }
        }
        private DateTime inputDate;
        public DateTime InputDate {
            get { return inputDate; }
            set { SetPropertyValue("InputDate", ref inputDate, value); }
        }
        private Pupil pupil;
        [Association("Pupil-Marks")]
        public Pupil Pupil {
            get { return pupil; }
            set { SetPropertyValue("Pupil", ref pupil, value); }
        }
        public override void AfterConstruction()
        {
            base.AfterConstruction();
            // Place here your initialization code.
        }
    }

    public enum MarkType { 
        BeginningTerm,
        MiddleTerm1,
        Term1,
        MiddleTerm2,
        Term2
    }
}
